// t3Pillar2.txt
// By Lazarus
// Hastes, blesses, shields, and gives resistance to enemy characters.
// Chooses two of these effects and puts them on all characters.
begincreaturescript;
variables;
short i,status1,status2;
body;

beginstate init_state;
	set_mobility(ME,0);
	if(get_flag(250,7) > 0)
		erase_char(ME);
break;

beginstate dead_state;
run_town_script(14);
break;

beginstate start_state;
if(get_flag(3,15) == 1)
	set_state_continue(3);
break;

beginstate 3;
if(char_ok(6) == 1)
if(get_health(6) <= 1500)
{	heal_char(6,(get_health(ME) + 500));
		put_jagged_zap(my_loc_x(),my_loc_y(),char_loc_x(6),char_loc_y(6),4);
		put_effect_on_char(6,10,10,0);
		run_animation_sound(60);
		kill_char(ME,2,0);
		message_dialog("Janok makes a gesture with his hand and an arc of energy from one of the nearby pillars strikes him. His wounds close up, but the pillar is ruined.","");  }

	status1 = get_ran(1,1,4);
	status2 = get_ran(1,1,4);
	while(status1 == status2)
	{	status2 = get_ran(1,1,4); }

	i = 6;
	while(i < 50)
	{ if((status1 == 1) || (status2 == 1))
	{	if(char_ok(i) == 1)
		{	if(i != 6)
			{	set_char_status(i,17,5,1,0);
				put_sparkles_on_char(i,3,10); }
			if(i == 6)
			{	set_char_status(i,17,6,1,0);
				put_sparkles_on_char(i,3,10); }
			print_named_str(i," becomes resistant."); }
}
	if((status1 == 2) || (status2 == 2))
	{	if(char_ok(i) == 1)
		{	if(i != 6)
			{	set_char_status(i,3,5,1,0);
				put_sparkles_on_char(i,0,10); }
			if(i == 6)
			{	set_char_status(i,3,6,0,0);
				put_sparkles_on_char(i,0,10); }
			print_named_str(i," is hasted."); }
}
	if((status1 == 3) || (status2 == 3))
	{	if(char_ok(i) == 1)
		{	if(i != 6)
			{	set_char_status(i,1,5,1,0);
				put_sparkles_on_char(i,0,10); }
			if(i == 6)
			{	set_char_status(i,1,6,1,0);
				put_sparkles_on_char(i,0,10); }
			print_named_str(i," is blessed."); }
}
	if((status1 == 4) || (status2 == 4))
	{	if(char_ok(i) == 1)
		{	if(i != 6)
			{	set_char_status(i,2,5,1,0);
				put_sparkles_on_char(i,0,10); }
			if(i == 6)
			{	set_char_status(i,2,6,1,0);
				put_sparkles_on_char(i,0,10); }
			print_named_str(i," is shielded."); }
}
		i = i + 1; }
	run_animation_sound(24);
	end_combat_turn();
break;
	